//
//  AromatherapySession.swift
//  HIextractLicve
//
//  Created by HIextractLicve on 2024/12/9.
//

import UIKit

class AromatherapySession: UICollectionViewCell {

    @IBOutlet weak var payworthTHLC: UILabel!
    
    @IBOutlet weak var noqingCountLbl: UILabel!
    var eachVioViewHTLC:THLCNOrBUTTOn?
    var mindfulnessPageHTL:THLCNPageControll?
    var journeyHTLC:UIView?
    
    var mindfulness:Set<Int>?
    
    var suggestion:Set<String>?
    
    var  professionals:Set<CGFloat>?
    
    var exchangeHTLC:[String:Array<Dictionary<String,String>>]?
    
    override func awakeFromNib() {
        super.awakeFromNib()
        payworthTHLC.layer.cornerRadius = 20
        payworthTHLC.layer.masksToBounds = true
        mindfulness = [99]
        suggestion = ["decompression"]
        professionals = [12.1]
        exchangeHTLC = ["themtopicHTLC":[["decompression":"098"]]]
        self.layer.cornerRadius = 24
        self.layer.masksToBounds = true
        if self.contentView.isHidden == true {
            journeyHTLC?.alpha = 1
            journeyHTLC?.layer.cornerRadius = 12
        }
        journeyHTLC?.backgroundColor = UIColor(red: 0.06, green: 0.07, blue: 0.07, alpha: 0.01)

        eachVioViewHTLC = THLCNOrBUTTOn.init()
        eachVioViewHTLC?.setTitle("anchors", for: .normal)
       

    }

    override var isSelected: Bool{
        didSet{
            if journeyHTLC != nil {
                journeyHTLC?.addSubview(eachVioViewHTLC ?? THLCNOrBUTTOn.init())
                contentView.addSubview(journeyHTLC!)
            }

            
            mindfulnessPageHTL?.numberOfPages = 1
            mindfulnessPageHTL?.backgroundColor = UIColor(red: 0.06, green: 0.07, blue: 0.07, alpha: 0.01)
            mindfulnessPageHTL?.tintColor = UIColor(red: 0.06, green: 0.07, blue: 0.07, alpha: 0.01)
            mindfulnessPageHTL?.sizeToFit()

            if journeyHTLC != nil {
                journeyHTLC?.addSubview(mindfulnessPageHTL ?? THLCNPageControll.init())
               
            }
            if isSelected {
                self.backgroundColor = UIColor(red: 1, green: 0.01, blue: 0.33, alpha: 1)
                payworthTHLC.textColor = UIColor(red: 0.06, green: 0.07, blue: 0.07, alpha: 1)
                payworthTHLC.textColor = .black
                payworthTHLC.backgroundColor = .white
            
                
            }else{
                self.backgroundColor = UIColor.init(white: 1, alpha: 0.1)
                payworthTHLC.textColor = UIColor(red: 0.06, green: 0.07, blue: 0.07, alpha: 1)
                payworthTHLC.textColor = .white
                payworthTHLC.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha:0.4)
            }
        }
    }
    
}
